<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

<script>
    var username = '张三'
    var age = 18
    function say() {
        console.log(this.username, this.age)
    }
    var obj = {
        username,
        age,
        say,
    }
    console.log(obj)


    var obj = {
        username: '张三',
        age: 18,
        say() {
            console.log(this.username, this.age)
        }
    }
    console.log(obj)


    // var m = new Map()

    // m.set('username', obj.username).set('age', 18)
    // console.log(m)

</script>

</html>